<div class="content_filtro">
    <div class="filtro">
        <form id="form_filtro" method="post" action="">
            <i>Pesquisar</i>
            
            <div class="row">
                <input type="text" name="dsfiltro" placeholder="Arquivo" value="<?php echo $this->dsfiltro?>" />

                <input type="submit" class="btn-pdr" name="buscar" value="buscar" />
            </div>
        </form>
    </div>
    <?php 
        $mostrar = TRUE;
        if(isset($this->cur['CUR_REDCOR']) && $this->cor['TOTAL'] >= $this->cur['CUR_REDCOR']) $mostrar = FALSE;
    ?>
    <?php if($this->per_add && $mostrar){?>
    <div class="content-btn">
        <span>Novo</span><a href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit','eva_id'=>$this->eva_id,'id'=>'')); ?>">+</a>
    </div>
    <?php } ?>
    
</div>

<div class="content-list">
    
    <h2><?php echo $this->titulo;?></h2>
    
    <table id="tlist">
        <thead>
            <tr>
                <th>Data</th>
                <th>Arquivo</th>
                <th>Status</th>
                <th class="bc">&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($this->result as $row) { 
                $link = glob('public/upload/enviodearquivocorrecao/'.$row['EVA_ID'].$row['EVC_LTR'].'.*');
                $link = isset($link[0]) ? $link[0]:'';
                
                $nome_arq = '';
                if(strlen($link) > 0){
                    $nome_arq = $row['EVA_ID'].$row['EVC_LTR'].'.'.end(explode('.', $link));
                }
                
                $btn_txt = $row['EVC_TPO'] == 0 ? 'Redação':'Correção';
                
            ?>
                <tr>
                    <td><?php echo Datetools::invertDH_D($row['EVC_DATHOR']); ?></td>
                    <td><?php echo $nome_arq; ?></td>
                    <td><?php echo dominio::getTpoEnvArq($row['EVC_TPO']);?></td>
                    <td class="bc">
                        <?php if($this->per_edt){?><a class="btn-pdr" target="_blank" href="<?php echo $this->urlbase.'/'.$link; ?>">Visualizar</a><?php }?>
                    </td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
</div>
<br><a href="<?php echo $this->url(array('controller' => 'enviodearquivo')); ?>">Voltar para redações enviadas</a>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>